package org.coding.springbootdemocommandline;

/**
 * @author guoxuehe
 * @date 2021/1/25 12:54
 * @desc
 **/
public class JavaValueDemo {

    public static void main(String[] args) {
        JavaValueDemo javaValueDemo = new JavaValueDemo();
        javaValueDemo.test("张三"); //此处的 "张三" 就是实参

        int i = 10;
        javaValueDemo.pass(i);
        System.out.println("print in pass ,i is " +i);

        TestDTO dto = new TestDTO();
        dto.setName("张三");
        javaValueDemo.passDto(dto);
        System.out.println("print in main ,testdto is " +dto);

        String name = "王五";
        javaValueDemo.pass(name);
        System.out.println("print in main ,testdto is " +name);
    }

    public void test(String name){ //此处的name就是形参
        System.out.println(name);
    }

    public void pass (int j){
        j = 20;
        System.out.println("print in pass ,j is " +j);
    }

    public void passDto(TestDTO testDTO){
        testDTO.setName("abc");
        System.out.println("print in pass ,testdto is " +testDTO);

    }

    public void pass(String name){
        name = "李四";
        System.out.println("print in pass ,name is " +name);
    }
}
